<?php
//读取文本
$str = explode("\n", file_get_contents('sinetxt.txt'));
$k = rand(0,count($str));
$sina_img = str_re($str[$k]);

$url = 'http://ali.iqovo.cn:3366/url.php?url=https://www.wallpapermaiden.com/wallpaper/'.$sina_img.'-anime.jpeg';
$result=array("code"=>"200","acgurl"=>"$url");

$type=$_GET['return'];
switch ($type)   

{   
   
//txt文本输出                           
case 'txt':
$img = file_get_contents($url,true);
header("Content-type:text/json");
echo $url;
break;
//IMG
default:
header("Location:".$result['acgurl']);
break;
}
function str_re($str){
  $str = str_replace(' ', "", $str);
  $str = str_replace("\n", "", $str);
  $str = str_replace("\t", "", $str);
  $str = str_replace("\r", "", $str);
  return $str;
}
?>